package controllers

import (
	"goetl/services"

	"github.com/astaxie/beego"
	//"github.com/astaxie/beego/logs"
)

type MainController struct {
	beego.Controller
}

func (c *MainController) Get() {
	//c.Data["Website"] = "beego.me"
	//c.Data["Email"] = "astaxie@gmail.com"
	//	l := logs.GetLogger()
	Cfg := beego.AppConfig
	login_id := Cfg.String("DEFAULT_USER")

	err, user := services.OperationsService.FindUserByLoginId(login_id)

	if err == nil {
		user.Password = ""
		c.Data["userName"] = user.LoginId

		c.SetSession("user", user)
		//	l.Println(user.LoginId)
		//	l.Println(user.UserSettings)
	}

	c.TplName = "index.tpl"
}
